
#ifndef __APP_CMOS_H__
#define __APP_CMOS_H__


/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported define -----------------------------------------------------------*/
#define CMOS_I2C_DEVADDR			0x6E	// 0x6E(write mode), 0x6F(read mode)
#define	CMOS_MAX_WIDTH				1600
#define	CMOS_MAX_HEIGHT				1200

#define	CMOS_IMG_TOUCH_WIDTH		CMOS_MAX_WIDTH
#define	CMOS_IMG_SIDEVIEW_WIDTH		200	// CMOS_MAX_WIDTH / 8 : sub sampling
#define	CMOS_IMG_SIDEVIEW_HEIGHT	25

#define	CMOS_DEF_YCENTER			((CMOS_MAX_HEIGHT>>1) - 1)

// 6400 = ImgCur(1600)+ImgMax(1600)+ThdCur(1600)+ThdMax(1600)
// 4100 = 2500(Sideview) + 1600
#define	CMOS_MAX_PIXEL_BUF			6400

/* Exported functions ------------------------------------------------------- */
void Cmos_Init(void);
void Cmos_Proc(void);

void Cmos_ChangeState(u8 state);
u8 Cmos_SideviewStart(u8 bStart);
u8 Cmos_DetectionStart(u8 bStart);

void Cmos_ChangeYCenter(s16 nYCenter);
void Cmos_ChangeXStart(u16 wXStart);
void Cmos_ChangeXEnd(u16 wXEnd);
void Cmos_ChangeThreshold(u8 bThreshold);


//void EXTI0_IRQHandler(void);
//void EXTI1_IRQHandler(void);
//void EXTI4_IRQHandler(void);

/* External variables --------------------------------------------------------*/

#endif /*__APP_CMOS_H__*/

